<?php

namespace Modules\DataAnalysis\Http\Controllers;

use App\Helpers\QueryBuilder;
use App\Http\Controllers\ApiBaseController;
use App\Http\Resources\BaseResource;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Admin\Entities\Permission;

class DataAnalysisController extends ApiBaseController
{
    protected ?array $except = ['test'];

    public function test()
    {
        $query = Permission::query();
        $lists = QueryBuilder::for($query)
            ->fields()
            ->filters(['title'])
            ->includes()
            ->sorts(['sort'])
            ->page();
        return $this->success(BaseResource::collection($lists));
    }
}
